package com.lifeng.jk.service.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lifeng.jk.dao.FactoryDao;
import com.lifeng.jk.dao.SysUserDao;
import com.lifeng.jk.domain.Factory;
import com.lifeng.jk.domain.SysUser;
import com.lifeng.jk.service.FactoryService;
import com.lifeng.jk.service.SysUserService;

@Service
public class SysUserServiceImpl implements SysUserService{
	@Autowired
	private SysUserDao sysUserDao;
	
	@Override
	public List<SysUser> find(Map paraMap) {
		return sysUserDao.find(paraMap);
	}

	@Override
	public SysUser get(Serializable id) {
		return sysUserDao.get(id);
	}

	@Override
	public void insert(SysUser entity) {
		entity.setId(UUID.randomUUID().toString());	
		entity.setStates("1");
		sysUserDao.insert(entity);
	}

	@Override
	public void update(SysUser entity) {
		sysUserDao.update(entity);
	}

	@Override
	public void deleteById(Serializable id) {
		sysUserDao.deleteById(id);
	}

	@Override
	public void delete(Serializable[] ids) {
		sysUserDao.delete(ids);
	}

	@Override
	public SysUser login(String userCode, String password) {
		return sysUserDao.findByUserCodeAndPasswd(userCode, password);
	}

	@Override
	public List<SysUser> findByJobsCode(String jobsCode) {
		return sysUserDao.findByJobsCode(jobsCode);
	}

}
